package cf.test;

import org.apache.log4j.Logger;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import cf.model.User;
import cf.service.UserServiceI;
import com.alibaba.fastjson.JSON;

public class JunitTestMybatis1 {

	private static final Logger logger = Logger.getLogger(JunitTestMybatis1.class);
	
	@Test
	public void test1() {
		ApplicationContext ac = new ClassPathXmlApplicationContext(new String[] {"spring.xml", "spring-mybatis.xml"});
		UserServiceI userService = (UserServiceI) ac.getBean("userService");
		
		User u = userService.getUserById((long) 1);
		logger.info(JSON.toJSONStringWithDateFormat(u, "yyyy-MM-dd HH:mm:ss"));
	}

}
